package com.floreantpos.model.base;

import java.io.Serializable;
import java.lang.Comparable;


/**
 * This is an object that contains data related to the RESTAURANT table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="POS_CONFIG"
 */
public class BasePOSConfig implements Comparable, Serializable{

	public static String REF = "POSConfig";
	public static String PROP_ID = "id";
	public static String PROP_LOGO = "logo";
	public static String PROP_DELI = "deli";
	
	private int id;
	private String logo;
	private String deli;
	
	private int hashCode = Integer.MIN_VALUE;

	
	public BasePOSConfig(){
		initialize();

	}
	
	
	public BasePOSConfig(int id) {
		// TODO Auto-generated constructor stub
	}


	private void initialize() {
		
	}

	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="assigned"
     *  column="ID"
     */
	public java.lang.Integer getId() {
		return id;
	}


	public void setId(java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}


	public String getLogo() {
		return logo;
	}


	public void setLogo(String logo) {
		this.logo = logo;
	}


	public String getDeli() {
		return deli;
	}


	public void setDeli(String deli) {
		this.deli = deli;
	}

	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.floreantpos.model.Restaurant)) return false;
		else {
			com.floreantpos.model.POSConfig posConfig = (com.floreantpos.model.POSConfig) obj;
			if (null == this.getId() || null == posConfig.getId()) return false;
			else return (this.getId().equals(posConfig.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}

	public int compareTo (Object obj) {
		if (obj.hashCode() > hashCode()) return 1;
		else if (obj.hashCode() < hashCode()) return -1;
		else return 0;
	}

	public String toString () {
		return super.toString();
	}

}
